using System.Collections;
using UnityEngine;
namespace DefaultNamespace
{
    public class MyCustomEnumerator : IEnumerator
    {
        private int _state = 0;
        public object Current
        {
            get
            {
                // 返回当前状态的值（可选）
                return _state;
            }
        }
        public bool MoveNext()
        {
            _state++;
            Debug.Log("Current value: " + _state);
            if (_state < 5)
            {
                return true; // 继续迭代
            } else
            {
                return false; // 迭代结束
            }
        }
        public void Reset()
        {
            _state = 0;
        }
    }
}